﻿@{
    List<Century.Model.CMS.Site> sites= Html.GetSites();
    Century.Model.CMS.Site currentSite = Html.CurrentSite();
}
<a class="languageMainLink" href="#">
    <img src="/content/themes/default/img/general/flags/@(sites.Any(c => c.Id == currentSite.Id) ? sites.First(c => c.Id == currentSite.Id).Flag : sites.First(c => c.Path.ToLower() == "en").Flag)" alt="" class="languageFlag" />
    <span class="languageSpan">@(sites.Any(c => c.Id == currentSite.Id) ? sites.First(c => c.Id == currentSite.Id).Name : sites.First(c => c.Path.ToLower() == "en").Name)</span>
    <img src="@Url.Content("~/content/themes/default/img/header/languageBoxIcon.png")"" alt="" class="languageBoxArrow" />
</a>
<div class="languageBoxMenuDiv" style="display: none;">
    <ul>
        @foreach (Century.Model.CMS.Site item in sites)
        {
            <li><a title="@item.Name" href="@(Request.Url.Host == "localhost" ? string.Format("http://{0}/{1}/", Request.Url.Authority ,item.Path) : item.SiteAddress)" >
                <div>
                    <img src="/content/themes/default/img/general/flags/@item.Flag" alt="@item.Flag" /><span>@item.Name</span>
                </div>
            </a></li>
        }
    </ul>
</div>

